import { createRouter, createWebHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router'; 
import HomePage from '../components/HomePage.vue';
import Login from '../components/Login.vue';
import Register from '../components/Register.vue';
import ForgotPassword from '../components/ForgotPassword.vue';
import Orther from '@/components/orther.vue';
import GoodsDetail from '../components/GoodsDetail.vue'
import SearchPage from '../components/SearchPage.vue'
import New from '../components/new.vue'
import SuppingCar from '@/components/suppingCar.vue';
import Message from '@/components/Message.vue';
import userInfo from '@/components/userInfo.vue';
import Buy from '@/components/buy.vue';
import Release from '@/components/release.vue';
import UploadInformation from '../components/uploadInformation.vue'
import InforMationDetail from '../components/informationDetail.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: HomePage
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path:'/register',
    name:'Register',
    component:Register
  },
  {
    path:'/forgotPassword',
    name:'ForgotPassword',
    component:ForgotPassword
  },
  {
    path:'/orther',
    name:'Orther',
    component:Orther
  },{
    path: '/goods/:id',
    name: 'GoodsDetail',
    component: GoodsDetail,
    props: true // 将路由参数作为 props 传递给组件
  },{
    path: '/search',
    name: 'SearchPage',
    component: SearchPage
  },{
    path:'/new',
    name: 'New',
    component:New
  },{
    path:'/suppingCar',
    name:'SuppingCar',
    component:SuppingCar
  },{
    path: '/message/:id',
    name: 'Message',
    component: Message,
    props: true // 将路由参数作为 props 传递给组件
  },{
    path: '/messageNoId',
    name: 'MessageNoId',
    component: Message
  },{
    path:'/userInfo',
    name:'UserInfo',
    component:userInfo
  },{
    path: '/buy',
    name: 'Buy',
    component: Buy
  },{
    path:'/release',
    name:'Release',
    component:Release
    
  }
  ,{
    path:'/uploadInformation',
    name:'UploadInformation',
    component:UploadInformation
  },{
    path: '/inforMationDetail/:id',
    name: 'InforMationDetail',
    component: InforMationDetail,
    props: true // 将路由参数作为 props 传递给组件
  }
];

const router = createRouter({
  history: createWebHistory(),
  routes
});
export default router;
